package com.lqq.sparrow.invoke.provider;

import java.util.ServiceLoader;

/**
 * @author liangqq
 */
public abstract class AbstractServer implements Server{



    public static Server getServer(){
        ServiceLoader<Server> servers = ServiceLoader.load(Server.class);
        for (Server s : servers) {
            //s.shout();
            System.out.println(s);
            return s;
        }

        throw new RuntimeException("没有服务");
    }
}
